{extends file="./main.tpl"}
{block name=head}
<style type="text/css" title="currentStyle">
  @import "./media/css/demo_page.css";
  @import "./media/css/demo_table_jui.css";
  @import "./media/css/jquery-ui-1.8.4.custom.css";
</style>
<script type="text/javascript" language="javascript" src="./media/js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="./media/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
  $(document).ready(function() 
  {
	  oTable = $('#example').dataTable(
	  {
		  "bJQueryUI": true,
		  "sPaginationType": "full_numbers",
		  "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]]
	  });
  });
</script>
<script type="text/javascript">
  $(document).ready(function() {
    $('#truckNo').focus();
  });
function myFunction()
{
  if(confirm("You Want To Remove This Record")== true)
	{
		return true;
	}
	else
	{
		return false;
	}
}
</script>
{/block}
{block name=body}
<form name="party" action="{$smarty.server.PHP_SELF}" method="post" onsubmit="return confirm('DO You Want To Submit !!!!!')";>
	<table align="center" border="2" cellpadding="2" cellspacing="2" width="" >
	  <tr>
	    <td align="center" class="table1" colspan="6"><b>Truck Master</b></td>
	  </tr>
	  <tr>
	    <td class="table2"  align="center" colspan="3" >Truck No :<input type="text" name="truckNo"  autofocus=autofocus required="required" /></td>
	    <td class="table2" align="center" colspan="3">Registration No :<input type="text" name="regNo" ></td>
	  </tr>
	  <tr>
	    <td class="table1" align="center" colspan="6" ><b>Insurance details</b></td>
	  </tr>
	  <tr>
	  	<td class="table2" align="right" colspan="1">Issue Date :</td>
	    <td class="table2" align="left">{html_select_date prefix="issue" start_year ="2001" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
	    <td class="table2" align="right">Expiry Date :</td>
	    <td class="table2">{html_select_date prefix="expDate" start_year ="2001" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
	    <td class="table2" align="right">Amount :</td>
	    <td class="table2"><input type="text" name="amount" ></td>
	  </tr>
	  <td class="table1" colspan="6"></td>
	  <tr>
	    <td class="table2"  align="right">National Permit :</td>
	    <td class="table2">
	      <input type="text" name="nationalPermit" >
	    </td>
	    <td class="table2">National Permit Amount :</td>
	    <td class="table2"><input type="text" name="nationalPermitAmount" ></td>
	    <td class="table2"  align="right" >Gujarat Tax :</td>
	    <td class="table2" ><input type="text" name="gujratTax" ></td>
	  </tr>
	  <tr>
	  	<td class="table2" align="right" colspan="">Passing Date :</td>
	    <td class="table2" align="center">{html_select_date prefix="passing" start_year ="2001" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
	    <td class="table2" align="right">PUC Date :</td>
	    <td class="table2" colspan="3">{html_select_date prefix="puc" start_year ="2001" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
	  </tr>
	  <tr>
	  	<td class="table2" align="right" colspan="">Installment start date :</td>
	    <td class="table2" align="center">{html_select_date prefix="instalment" start_year ="2001" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
	    <td class="table2" align="right">Total Installment :</td>
	    <td class="table2"><input type="text" name="totalInstallment" ></td>
	    <td class="table2" align="right">Installment  Amount :</td>
	    <td class="table2"><input type="text" name="installmentAmount" ></td>
	  </tr>
	  <tr>
	    <td class="table1" align="center" colspan="6"><input type="submit" name="insertBtn" value="Submit" class="button" /></td>
	  </tr>
	</table>
</form>
<br /><br />

<body id="dt_example">
  <div class="demo_jui">
	  <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
		  <thead>
			  <tr>
				  <th NOWRAP><b>&nbsp;</b></th>
					<th NOWRAP><b>Truck No </b></th>
					<th NOWRAP><b>Registration No </b></th>
					<th NOWRAP><b>Insurance Issue Date </b></th>
					<th NOWRAP><b>Insurance Expiry Date </b></th>
					<th NOWRAP><b>Amount</b></th>
					<th NOWRAP><b>National Permit </b></th>
					<th NOWRAP><b>National Permit Amount </b></th>
					<th NOWRAP><b>Gujarat Tax </b></th>
					<th NOWRAP><b>Passing Date</b></th>
					<th NOWRAP><b>PUC Date</b></th>
					<th NOWRAP><b>installment start date</b></th>
					<th NOWRAP><b>Total Installment</b></th>
					<th NOWRAP><b>installment Amount</b></th>
				</tr>
			</thead>
			<tbody>
			  {section name="sec" loop=$truckArray}
			    <tr class="gradeC">
			      <td align="center"><a href="truckDelete.php?truckId={$truckArray[sec].truckId}" onclick="return myFunction();" class="link"> <img src="./images/deleteIco.png"></a></td>
		        <td NOWRAP>{$truckArray[sec].truckNo}</td>
		        <td NOWRAP>{$truckArray[sec].regNo}</td>
		        <td NOWRAP align="center">{$truckArray[sec].issueDate}</td>
		        <td NOWRAP align="center">{$truckArray[sec].expDate}</td>
		        <td NOWRAP align="right">{$truckArray[sec].amount}</td>
		        <td NOWRAP>{$truckArray[sec].nationalPermit}</td>
		        <td NOWRAP align="right">{$truckArray[sec].nationalPermitAmount}</td>
		        <td NOWRAP align="right">{$truckArray[sec].gujratTax}</td>
		        <td NOWRAP>{$truckArray[sec].passingDate}</td>
		        <td NOWRAP>{$truckArray[sec].pucDate}</td>
		        <td NOWRAP>{$truckArray[sec].installmentStartDate}</td>
		        <td NOWRAP align="right">{$truckArray[sec].totalInstallment}</td>
		        <td NOWRAP align="right">{$truckArray[sec].installmentAmount}</td>
		      </tr>
			  {/section}
			</tbody>
		</table>
	</div>
	<div class="spacer"></div>
</body>
{/block}